﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
/* This class is resposible for the linkage between the user and his events, whether he is the admin or not!
 * Here we specify whether a certain user will attend this event or maybe or not. We are also linking him with
 * his responsibilities at every specific event!
 * Each class contains create and modified times for security reasons
 */
namespace Fish.Models
{
    public class EventUserRelations
    {
        public int ID { get; set; }
        public int EventsID { get; set; }
        public int UsersID { get; set; }

        [Required]
        public bool IsAdmin { get; set; }

        [Required]
        //Attending status: 0-going 1-maybe 2-not going
        public int AttendingStatus { get; set; }

        public virtual IList<MyTask> Tasks { get; set; }
        

        public virtual Events Events { get; set; }
        public virtual Users Users { get; set; }

        [DataType(DataType.DateTime)]
        [ScaffoldColumn(false)]
        public DateTime Created { get; set; }

        [DataType(DataType.DateTime)]
        [ScaffoldColumn(false)]
        public DateTime Modified { get; set; }
      
        public EventUserRelations()
        {
            Tasks = new List<MyTask>();
            this.Created = DateTime.Now;
            this.Modified = DateTime.Now;
        }
    }
}

public class MyTask
{
    public int ID { get; set; }
    public string taskMsg { get; set; }
}